import React, { Component } from 'react';
import { Row, Col, Input, InputNumber, PageHeader,Form, Button } from 'antd';
import List from '../../components/List/List';

import MyInput from '../../components/Input/input'
import NewsRecommend from '../../components/newsRecommend/newsRecommend'
import UsersRecommend from '../../components/usersRecommend/usersRecommend'






const layout = {
  labelCol: {
    span: 8,
  },
  wrapperCol: {
    span: 16,
  },
};


const validateMessages = {
  required: '${label} is required!',
  types: {
    email: '${label} is not a valid email!',
    number: '${label} is not a valid number!',
  },
  number: {
    range: '${label} must be between ${min} and ${max}',
  },
};


const onFinish = (values) => {
  console.log(values);
};



export default class Form1 extends Component {


  render() {
    return (

      <Row >
        <Col span={7}>
          <MyInput isRadius={true} delay={1000}></MyInput>
          {/* 需要传 isRadius delay防抖时间 */}
          <NewsRecommend></NewsRecommend>
          <UsersRecommend></UsersRecommend>
        </Col>


        <Col span={12}  >

        <PageHeader
                className="site-page-header-responsive"
                onBack={() => window.history.back()}
                //  用户名  和发推文量
                // title={this.state.nickname}
                subTitle="编辑个人资料"
              >
     
          </PageHeader>
          


          <Form {...layout} name="nest-messages" onFinish={onFinish} validateMessages={validateMessages}>
            <Form.Item
              name={['user', 'name']}
              label="Name"
              rules={[
                {
                  required: true,
                },
              ]}
            >
              <Input />
            </Form.Item>
            <Form.Item
              name={['user', 'email']}
              label="Email"
              rules={[
                {
                  type: 'email',
                },
              ]}
            >
              <Input />
            </Form.Item>
            <Form.Item
              name={['user', 'age']}
              label="Age"
              rules={[
                {
                  type: 'number',
                  min: 0,
                  max: 99,
                },
              ]}
            >
              <InputNumber />
            </Form.Item>
            <Form.Item name={['user', 'website']} label="Website">
              <Input />
            </Form.Item>
            <Form.Item name={['user', 'introduction']} label="Introduction">
              <Input.TextArea />
            </Form.Item>
            <Form.Item wrapperCol={{ ...layout.wrapperCol, offset: 8 }}>
              <Button type="primary" htmlType="submit">
                Submit
              </Button>
            </Form.Item>
          </Form>
        </Col>



        <Col span={5} ><List /></Col>
      </Row>
    )
  }
}
